package libtool65.vin;

import java.io.IOException;
import java.io.OutputStream;
import java.util.LinkedList;
import java.util.List;

import libtool65.vin.RelocationEntry;

public class RelocationList {
	private List<RelocationEntry> relocations = new LinkedList<RelocationEntry>();
	
	public boolean add(RelocationEntry entry)
	{
		return relocations.add(entry);
	}
	
	public int getByteSize()
	{
		int size = 0;
		for (RelocationEntry entry : relocations)
			size += entry.getSize();
		return size;
	}
	
	public void write(OutputStream file) throws IOException
	{
		for (RelocationEntry entry : relocations)
			entry.write(file);
	}

	public int getCount() {
		return relocations.size();
	}
}
